function* helloWorldGenerator() {
  console.log(1);
  let hello2 = yield hello();
  // throw new Error('111')
  yield hello2;
  // console.log(3);
  // return 'ending';
}

function hello() {
  // yield '小猫';
  // yield '小狗'
  // yield '小兔'
  // console.log(createAsyncIterable)
  return  1221
  // new Promise(function(resolve, reject) {
  //   setTimeout(function() {
  //     resolve('hello promise')
  //   }, 1000)
  // })
}

// for (const iterator of helloWorldGenerator()) {
//   console.log(iterator)
// }

var hw = helloWorldGenerator();
// console.log(hw.next().value.next())
// .then(res => {
//   console.log(res);
// })
console.log(hw.next())
console.log(hw.next(100))
console.log(hw.next())
console.log(hw.next(100))
console.log(hw.next())
// console.log(hw.next('after hello1'))

var a = Number(1);
var b = 2;
// console.log(typeof b)